<?php


abstract class BaseConference extends BaseObject  implements Persistent {


	
	protected static $peer;


	
	protected $id;


	
	protected $name;


	
	protected $description;


	
	protected $date_start;


	
	protected $date_end;


	
	protected $registration_deadline;


	
	protected $registration_early_deadline;


	
	protected $is_active;


	
	protected $member_fee_full;


	
	protected $member_fee_full_early;


	
	protected $member_fee_daily;


	
	protected $member_fee_daily_early;


	
	protected $nonmember_fee_full;


	
	protected $nonmember_fee_full_early;


	
	protected $nonmember_fee_daily;


	
	protected $nonmember_fee_daily_early;


	
	protected $fee_cancel;


	
	protected $created_at;

	
	protected $collSessions;

	
	protected $lastSessionCriteria = null;

	
	protected $collSpecialEvents;

	
	protected $lastSpecialEventCriteria = null;

	
	protected $collRegistrations;

	
	protected $lastRegistrationCriteria = null;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function getId()
	{

		return $this->id;
	}

	
	public function getName()
	{

		return $this->name;
	}

	
	public function getDescription()
	{

		return $this->description;
	}

	
	public function getDateStart($format = 'Y-m-d H:i:s')
	{

		if ($this->date_start === null || $this->date_start === '') {
			return null;
		} elseif (!is_int($this->date_start)) {
						$ts = strtotime($this->date_start);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [date_start] as date/time value: " . var_export($this->date_start, true));
			}
		} else {
			$ts = $this->date_start;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getDateEnd($format = 'Y-m-d H:i:s')
	{

		if ($this->date_end === null || $this->date_end === '') {
			return null;
		} elseif (!is_int($this->date_end)) {
						$ts = strtotime($this->date_end);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [date_end] as date/time value: " . var_export($this->date_end, true));
			}
		} else {
			$ts = $this->date_end;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getRegistrationDeadline($format = 'Y-m-d H:i:s')
	{

		if ($this->registration_deadline === null || $this->registration_deadline === '') {
			return null;
		} elseif (!is_int($this->registration_deadline)) {
						$ts = strtotime($this->registration_deadline);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [registration_deadline] as date/time value: " . var_export($this->registration_deadline, true));
			}
		} else {
			$ts = $this->registration_deadline;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getRegistrationEarlyDeadline($format = 'Y-m-d H:i:s')
	{

		if ($this->registration_early_deadline === null || $this->registration_early_deadline === '') {
			return null;
		} elseif (!is_int($this->registration_early_deadline)) {
						$ts = strtotime($this->registration_early_deadline);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [registration_early_deadline] as date/time value: " . var_export($this->registration_early_deadline, true));
			}
		} else {
			$ts = $this->registration_early_deadline;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getIsActive()
	{

		return $this->is_active;
	}

	
	public function getMemberFeeFull()
	{

		return $this->member_fee_full;
	}

	
	public function getMemberFeeFullEarly()
	{

		return $this->member_fee_full_early;
	}

	
	public function getMemberFeeDaily()
	{

		return $this->member_fee_daily;
	}

	
	public function getMemberFeeDailyEarly()
	{

		return $this->member_fee_daily_early;
	}

	
	public function getNonmemberFeeFull()
	{

		return $this->nonmember_fee_full;
	}

	
	public function getNonmemberFeeFullEarly()
	{

		return $this->nonmember_fee_full_early;
	}

	
	public function getNonmemberFeeDaily()
	{

		return $this->nonmember_fee_daily;
	}

	
	public function getNonmemberFeeDailyEarly()
	{

		return $this->nonmember_fee_daily_early;
	}

	
	public function getFeeCancel()
	{

		return $this->fee_cancel;
	}

	
	public function getCreatedAt($format = 'Y-m-d H:i:s')
	{

		if ($this->created_at === null || $this->created_at === '') {
			return null;
		} elseif (!is_int($this->created_at)) {
						$ts = strtotime($this->created_at);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [created_at] as date/time value: " . var_export($this->created_at, true));
			}
		} else {
			$ts = $this->created_at;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function setId($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->id !== $v) {
			$this->id = $v;
			$this->modifiedColumns[] = ConferencePeer::ID;
		}

	} 
	
	public function setName($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->name !== $v) {
			$this->name = $v;
			$this->modifiedColumns[] = ConferencePeer::NAME;
		}

	} 
	
	public function setDescription($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->description !== $v) {
			$this->description = $v;
			$this->modifiedColumns[] = ConferencePeer::DESCRIPTION;
		}

	} 
	
	public function setDateStart($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [date_start] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->date_start !== $ts) {
			$this->date_start = $ts;
			$this->modifiedColumns[] = ConferencePeer::DATE_START;
		}

	} 
	
	public function setDateEnd($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [date_end] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->date_end !== $ts) {
			$this->date_end = $ts;
			$this->modifiedColumns[] = ConferencePeer::DATE_END;
		}

	} 
	
	public function setRegistrationDeadline($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [registration_deadline] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->registration_deadline !== $ts) {
			$this->registration_deadline = $ts;
			$this->modifiedColumns[] = ConferencePeer::REGISTRATION_DEADLINE;
		}

	} 
	
	public function setRegistrationEarlyDeadline($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [registration_early_deadline] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->registration_early_deadline !== $ts) {
			$this->registration_early_deadline = $ts;
			$this->modifiedColumns[] = ConferencePeer::REGISTRATION_EARLY_DEADLINE;
		}

	} 
	
	public function setIsActive($v)
	{

		if ($this->is_active !== $v) {
			$this->is_active = $v;
			$this->modifiedColumns[] = ConferencePeer::IS_ACTIVE;
		}

	} 
	
	public function setMemberFeeFull($v)
	{

		if ($this->member_fee_full !== $v) {
			$this->member_fee_full = $v;
			$this->modifiedColumns[] = ConferencePeer::MEMBER_FEE_FULL;
		}

	} 
	
	public function setMemberFeeFullEarly($v)
	{

		if ($this->member_fee_full_early !== $v) {
			$this->member_fee_full_early = $v;
			$this->modifiedColumns[] = ConferencePeer::MEMBER_FEE_FULL_EARLY;
		}

	} 
	
	public function setMemberFeeDaily($v)
	{

		if ($this->member_fee_daily !== $v) {
			$this->member_fee_daily = $v;
			$this->modifiedColumns[] = ConferencePeer::MEMBER_FEE_DAILY;
		}

	} 
	
	public function setMemberFeeDailyEarly($v)
	{

		if ($this->member_fee_daily_early !== $v) {
			$this->member_fee_daily_early = $v;
			$this->modifiedColumns[] = ConferencePeer::MEMBER_FEE_DAILY_EARLY;
		}

	} 
	
	public function setNonmemberFeeFull($v)
	{

		if ($this->nonmember_fee_full !== $v) {
			$this->nonmember_fee_full = $v;
			$this->modifiedColumns[] = ConferencePeer::NONMEMBER_FEE_FULL;
		}

	} 
	
	public function setNonmemberFeeFullEarly($v)
	{

		if ($this->nonmember_fee_full_early !== $v) {
			$this->nonmember_fee_full_early = $v;
			$this->modifiedColumns[] = ConferencePeer::NONMEMBER_FEE_FULL_EARLY;
		}

	} 
	
	public function setNonmemberFeeDaily($v)
	{

		if ($this->nonmember_fee_daily !== $v) {
			$this->nonmember_fee_daily = $v;
			$this->modifiedColumns[] = ConferencePeer::NONMEMBER_FEE_DAILY;
		}

	} 
	
	public function setNonmemberFeeDailyEarly($v)
	{

		if ($this->nonmember_fee_daily_early !== $v) {
			$this->nonmember_fee_daily_early = $v;
			$this->modifiedColumns[] = ConferencePeer::NONMEMBER_FEE_DAILY_EARLY;
		}

	} 
	
	public function setFeeCancel($v)
	{

		if ($this->fee_cancel !== $v) {
			$this->fee_cancel = $v;
			$this->modifiedColumns[] = ConferencePeer::FEE_CANCEL;
		}

	} 
	
	public function setCreatedAt($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [created_at] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->created_at !== $ts) {
			$this->created_at = $ts;
			$this->modifiedColumns[] = ConferencePeer::CREATED_AT;
		}

	} 
	
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->id = $rs->getInt($startcol + 0);

			$this->name = $rs->getString($startcol + 1);

			$this->description = $rs->getString($startcol + 2);

			$this->date_start = $rs->getTimestamp($startcol + 3, null);

			$this->date_end = $rs->getTimestamp($startcol + 4, null);

			$this->registration_deadline = $rs->getTimestamp($startcol + 5, null);

			$this->registration_early_deadline = $rs->getTimestamp($startcol + 6, null);

			$this->is_active = $rs->getBoolean($startcol + 7);

			$this->member_fee_full = $rs->getFloat($startcol + 8);

			$this->member_fee_full_early = $rs->getFloat($startcol + 9);

			$this->member_fee_daily = $rs->getFloat($startcol + 10);

			$this->member_fee_daily_early = $rs->getFloat($startcol + 11);

			$this->nonmember_fee_full = $rs->getFloat($startcol + 12);

			$this->nonmember_fee_full_early = $rs->getFloat($startcol + 13);

			$this->nonmember_fee_daily = $rs->getFloat($startcol + 14);

			$this->nonmember_fee_daily_early = $rs->getFloat($startcol + 15);

			$this->fee_cancel = $rs->getFloat($startcol + 16);

			$this->created_at = $rs->getTimestamp($startcol + 17, null);

			$this->resetModified();

			$this->setNew(false);

						return $startcol + 18; 
		} catch (Exception $e) {
			throw new PropelException("Error populating Conference object", $e);
		}
	}

	
	public function delete($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(ConferencePeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			ConferencePeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public function save($con = null)
	{
    if ($this->isNew() && !$this->isColumnModified(ConferencePeer::CREATED_AT))
    {
      $this->setCreatedAt(time());
    }

		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(ConferencePeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	protected function doSave($con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;


						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = ConferencePeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setId($pk);  
					$this->setNew(false);
				} else {
					$affectedRows += ConferencePeer::doUpdate($this, $con);
				}
				$this->resetModified(); 			}

			if ($this->collSessions !== null) {
				foreach($this->collSessions as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collSpecialEvents !== null) {
				foreach($this->collSpecialEvents as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collRegistrations !== null) {
				foreach($this->collRegistrations as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


			if (($retval = ConferencePeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}


				if ($this->collSessions !== null) {
					foreach($this->collSessions as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collSpecialEvents !== null) {
					foreach($this->collSpecialEvents as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collRegistrations !== null) {
					foreach($this->collRegistrations as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}


			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = ConferencePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getId();
				break;
			case 1:
				return $this->getName();
				break;
			case 2:
				return $this->getDescription();
				break;
			case 3:
				return $this->getDateStart();
				break;
			case 4:
				return $this->getDateEnd();
				break;
			case 5:
				return $this->getRegistrationDeadline();
				break;
			case 6:
				return $this->getRegistrationEarlyDeadline();
				break;
			case 7:
				return $this->getIsActive();
				break;
			case 8:
				return $this->getMemberFeeFull();
				break;
			case 9:
				return $this->getMemberFeeFullEarly();
				break;
			case 10:
				return $this->getMemberFeeDaily();
				break;
			case 11:
				return $this->getMemberFeeDailyEarly();
				break;
			case 12:
				return $this->getNonmemberFeeFull();
				break;
			case 13:
				return $this->getNonmemberFeeFullEarly();
				break;
			case 14:
				return $this->getNonmemberFeeDaily();
				break;
			case 15:
				return $this->getNonmemberFeeDailyEarly();
				break;
			case 16:
				return $this->getFeeCancel();
				break;
			case 17:
				return $this->getCreatedAt();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = ConferencePeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getId(),
			$keys[1] => $this->getName(),
			$keys[2] => $this->getDescription(),
			$keys[3] => $this->getDateStart(),
			$keys[4] => $this->getDateEnd(),
			$keys[5] => $this->getRegistrationDeadline(),
			$keys[6] => $this->getRegistrationEarlyDeadline(),
			$keys[7] => $this->getIsActive(),
			$keys[8] => $this->getMemberFeeFull(),
			$keys[9] => $this->getMemberFeeFullEarly(),
			$keys[10] => $this->getMemberFeeDaily(),
			$keys[11] => $this->getMemberFeeDailyEarly(),
			$keys[12] => $this->getNonmemberFeeFull(),
			$keys[13] => $this->getNonmemberFeeFullEarly(),
			$keys[14] => $this->getNonmemberFeeDaily(),
			$keys[15] => $this->getNonmemberFeeDailyEarly(),
			$keys[16] => $this->getFeeCancel(),
			$keys[17] => $this->getCreatedAt(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = ConferencePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setId($value);
				break;
			case 1:
				$this->setName($value);
				break;
			case 2:
				$this->setDescription($value);
				break;
			case 3:
				$this->setDateStart($value);
				break;
			case 4:
				$this->setDateEnd($value);
				break;
			case 5:
				$this->setRegistrationDeadline($value);
				break;
			case 6:
				$this->setRegistrationEarlyDeadline($value);
				break;
			case 7:
				$this->setIsActive($value);
				break;
			case 8:
				$this->setMemberFeeFull($value);
				break;
			case 9:
				$this->setMemberFeeFullEarly($value);
				break;
			case 10:
				$this->setMemberFeeDaily($value);
				break;
			case 11:
				$this->setMemberFeeDailyEarly($value);
				break;
			case 12:
				$this->setNonmemberFeeFull($value);
				break;
			case 13:
				$this->setNonmemberFeeFullEarly($value);
				break;
			case 14:
				$this->setNonmemberFeeDaily($value);
				break;
			case 15:
				$this->setNonmemberFeeDailyEarly($value);
				break;
			case 16:
				$this->setFeeCancel($value);
				break;
			case 17:
				$this->setCreatedAt($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = ConferencePeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setName($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setDescription($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setDateStart($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setDateEnd($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setRegistrationDeadline($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setRegistrationEarlyDeadline($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setIsActive($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setMemberFeeFull($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setMemberFeeFullEarly($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setMemberFeeDaily($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setMemberFeeDailyEarly($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setNonmemberFeeFull($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setNonmemberFeeFullEarly($arr[$keys[13]]);
		if (array_key_exists($keys[14], $arr)) $this->setNonmemberFeeDaily($arr[$keys[14]]);
		if (array_key_exists($keys[15], $arr)) $this->setNonmemberFeeDailyEarly($arr[$keys[15]]);
		if (array_key_exists($keys[16], $arr)) $this->setFeeCancel($arr[$keys[16]]);
		if (array_key_exists($keys[17], $arr)) $this->setCreatedAt($arr[$keys[17]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(ConferencePeer::DATABASE_NAME);

		if ($this->isColumnModified(ConferencePeer::ID)) $criteria->add(ConferencePeer::ID, $this->id);
		if ($this->isColumnModified(ConferencePeer::NAME)) $criteria->add(ConferencePeer::NAME, $this->name);
		if ($this->isColumnModified(ConferencePeer::DESCRIPTION)) $criteria->add(ConferencePeer::DESCRIPTION, $this->description);
		if ($this->isColumnModified(ConferencePeer::DATE_START)) $criteria->add(ConferencePeer::DATE_START, $this->date_start);
		if ($this->isColumnModified(ConferencePeer::DATE_END)) $criteria->add(ConferencePeer::DATE_END, $this->date_end);
		if ($this->isColumnModified(ConferencePeer::REGISTRATION_DEADLINE)) $criteria->add(ConferencePeer::REGISTRATION_DEADLINE, $this->registration_deadline);
		if ($this->isColumnModified(ConferencePeer::REGISTRATION_EARLY_DEADLINE)) $criteria->add(ConferencePeer::REGISTRATION_EARLY_DEADLINE, $this->registration_early_deadline);
		if ($this->isColumnModified(ConferencePeer::IS_ACTIVE)) $criteria->add(ConferencePeer::IS_ACTIVE, $this->is_active);
		if ($this->isColumnModified(ConferencePeer::MEMBER_FEE_FULL)) $criteria->add(ConferencePeer::MEMBER_FEE_FULL, $this->member_fee_full);
		if ($this->isColumnModified(ConferencePeer::MEMBER_FEE_FULL_EARLY)) $criteria->add(ConferencePeer::MEMBER_FEE_FULL_EARLY, $this->member_fee_full_early);
		if ($this->isColumnModified(ConferencePeer::MEMBER_FEE_DAILY)) $criteria->add(ConferencePeer::MEMBER_FEE_DAILY, $this->member_fee_daily);
		if ($this->isColumnModified(ConferencePeer::MEMBER_FEE_DAILY_EARLY)) $criteria->add(ConferencePeer::MEMBER_FEE_DAILY_EARLY, $this->member_fee_daily_early);
		if ($this->isColumnModified(ConferencePeer::NONMEMBER_FEE_FULL)) $criteria->add(ConferencePeer::NONMEMBER_FEE_FULL, $this->nonmember_fee_full);
		if ($this->isColumnModified(ConferencePeer::NONMEMBER_FEE_FULL_EARLY)) $criteria->add(ConferencePeer::NONMEMBER_FEE_FULL_EARLY, $this->nonmember_fee_full_early);
		if ($this->isColumnModified(ConferencePeer::NONMEMBER_FEE_DAILY)) $criteria->add(ConferencePeer::NONMEMBER_FEE_DAILY, $this->nonmember_fee_daily);
		if ($this->isColumnModified(ConferencePeer::NONMEMBER_FEE_DAILY_EARLY)) $criteria->add(ConferencePeer::NONMEMBER_FEE_DAILY_EARLY, $this->nonmember_fee_daily_early);
		if ($this->isColumnModified(ConferencePeer::FEE_CANCEL)) $criteria->add(ConferencePeer::FEE_CANCEL, $this->fee_cancel);
		if ($this->isColumnModified(ConferencePeer::CREATED_AT)) $criteria->add(ConferencePeer::CREATED_AT, $this->created_at);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(ConferencePeer::DATABASE_NAME);

		$criteria->add(ConferencePeer::ID, $this->id);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		return $this->getId();
	}

	
	public function setPrimaryKey($key)
	{
		$this->setId($key);
	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setName($this->name);

		$copyObj->setDescription($this->description);

		$copyObj->setDateStart($this->date_start);

		$copyObj->setDateEnd($this->date_end);

		$copyObj->setRegistrationDeadline($this->registration_deadline);

		$copyObj->setRegistrationEarlyDeadline($this->registration_early_deadline);

		$copyObj->setIsActive($this->is_active);

		$copyObj->setMemberFeeFull($this->member_fee_full);

		$copyObj->setMemberFeeFullEarly($this->member_fee_full_early);

		$copyObj->setMemberFeeDaily($this->member_fee_daily);

		$copyObj->setMemberFeeDailyEarly($this->member_fee_daily_early);

		$copyObj->setNonmemberFeeFull($this->nonmember_fee_full);

		$copyObj->setNonmemberFeeFullEarly($this->nonmember_fee_full_early);

		$copyObj->setNonmemberFeeDaily($this->nonmember_fee_daily);

		$copyObj->setNonmemberFeeDailyEarly($this->nonmember_fee_daily_early);

		$copyObj->setFeeCancel($this->fee_cancel);

		$copyObj->setCreatedAt($this->created_at);


		if ($deepCopy) {
									$copyObj->setNew(false);

			foreach($this->getSessions() as $relObj) {
				$copyObj->addSession($relObj->copy($deepCopy));
			}

			foreach($this->getSpecialEvents() as $relObj) {
				$copyObj->addSpecialEvent($relObj->copy($deepCopy));
			}

			foreach($this->getRegistrations() as $relObj) {
				$copyObj->addRegistration($relObj->copy($deepCopy));
			}

		} 

		$copyObj->setNew(true);

		$copyObj->setId(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new ConferencePeer();
		}
		return self::$peer;
	}

	
	public function initSessions()
	{
		if ($this->collSessions === null) {
			$this->collSessions = array();
		}
	}

	
	public function getSessions($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseSessionPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collSessions === null) {
			if ($this->isNew()) {
			   $this->collSessions = array();
			} else {

				$criteria->add(SessionPeer::CONFERENCE_ID, $this->getId());

				SessionPeer::addSelectColumns($criteria);
				$this->collSessions = SessionPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(SessionPeer::CONFERENCE_ID, $this->getId());

				SessionPeer::addSelectColumns($criteria);
				if (!isset($this->lastSessionCriteria) || !$this->lastSessionCriteria->equals($criteria)) {
					$this->collSessions = SessionPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastSessionCriteria = $criteria;
		return $this->collSessions;
	}

	
	public function countSessions($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseSessionPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(SessionPeer::CONFERENCE_ID, $this->getId());

		return SessionPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addSession(Session $l)
	{
		$this->collSessions[] = $l;
		$l->setConference($this);
	}

	
	public function initSpecialEvents()
	{
		if ($this->collSpecialEvents === null) {
			$this->collSpecialEvents = array();
		}
	}

	
	public function getSpecialEvents($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseSpecialEventPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collSpecialEvents === null) {
			if ($this->isNew()) {
			   $this->collSpecialEvents = array();
			} else {

				$criteria->add(SpecialEventPeer::CONFERENCE_ID, $this->getId());

				SpecialEventPeer::addSelectColumns($criteria);
				$this->collSpecialEvents = SpecialEventPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(SpecialEventPeer::CONFERENCE_ID, $this->getId());

				SpecialEventPeer::addSelectColumns($criteria);
				if (!isset($this->lastSpecialEventCriteria) || !$this->lastSpecialEventCriteria->equals($criteria)) {
					$this->collSpecialEvents = SpecialEventPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastSpecialEventCriteria = $criteria;
		return $this->collSpecialEvents;
	}

	
	public function countSpecialEvents($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseSpecialEventPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(SpecialEventPeer::CONFERENCE_ID, $this->getId());

		return SpecialEventPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addSpecialEvent(SpecialEvent $l)
	{
		$this->collSpecialEvents[] = $l;
		$l->setConference($this);
	}

	
	public function initRegistrations()
	{
		if ($this->collRegistrations === null) {
			$this->collRegistrations = array();
		}
	}

	
	public function getRegistrations($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseRegistrationPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collRegistrations === null) {
			if ($this->isNew()) {
			   $this->collRegistrations = array();
			} else {

				$criteria->add(RegistrationPeer::CONFERENCE_ID, $this->getId());

				RegistrationPeer::addSelectColumns($criteria);
				$this->collRegistrations = RegistrationPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(RegistrationPeer::CONFERENCE_ID, $this->getId());

				RegistrationPeer::addSelectColumns($criteria);
				if (!isset($this->lastRegistrationCriteria) || !$this->lastRegistrationCriteria->equals($criteria)) {
					$this->collRegistrations = RegistrationPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastRegistrationCriteria = $criteria;
		return $this->collRegistrations;
	}

	
	public function countRegistrations($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseRegistrationPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(RegistrationPeer::CONFERENCE_ID, $this->getId());

		return RegistrationPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addRegistration(Registration $l)
	{
		$this->collRegistrations[] = $l;
		$l->setConference($this);
	}


	
	public function getRegistrationsJoinRegistrant($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseRegistrationPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collRegistrations === null) {
			if ($this->isNew()) {
				$this->collRegistrations = array();
			} else {

				$criteria->add(RegistrationPeer::CONFERENCE_ID, $this->getId());

				$this->collRegistrations = RegistrationPeer::doSelectJoinRegistrant($criteria, $con);
			}
		} else {
									
			$criteria->add(RegistrationPeer::CONFERENCE_ID, $this->getId());

			if (!isset($this->lastRegistrationCriteria) || !$this->lastRegistrationCriteria->equals($criteria)) {
				$this->collRegistrations = RegistrationPeer::doSelectJoinRegistrant($criteria, $con);
			}
		}
		$this->lastRegistrationCriteria = $criteria;

		return $this->collRegistrations;
	}

} 